package com.dotflat.satistics.vo.home;

import com.dotflat.satistics.utils.MathUtil;
import lombok.Data;

/**
 * *******************************
 * Created by Tim.
 * form com.matt
 * on 2018/7/25
 * *******************************
 */
@Data
public class DayPriceVo {
    private String timeName;
    private double totalAmount;
    private double count;
    private double unitPrice;

    public static DayPriceVo of(String timeName, double totalAmount, double count){
        DayPriceVo vo = new DayPriceVo();
        vo.setTimeName(timeName);
        vo.setTotalAmount(totalAmount);
        vo.setCount(count);
        vo.setUnitPrice(MathUtil.divide(vo.getTotalAmount(), vo.getCount()));
        return vo;
    }
}
